<?php
namespace app\app\controller;
use think\Db;
class Home extends Common
{
    //获取广告图    home/get_carousel
    public function get_carousel()
    {
        $msg['state'] = 1;
        $msg['msg'] = '获取成功';
        $msg['data'] = Db::table('carousel')->field('url,image,time,status')->where(['type'=>1])->order('id desc')->find();
        return json($msg);
    }

    //获取活动图   home/get_activity
    public function get_activity()
    {
        $msg['state'] = 1;
        $msg['msg'] = '获取成功';
        $msg['data'] = Db::table('carousel')->field('activity_id,title,url,image,status')->where(['type'=>2])->order('id desc')->find();
        return json($msg);
    }
}